package com.example.pojo;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
* <p>
* 菜单表
* </p>
*
* @author wsl
* @since 2022-03-27
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "Menu对象", description = "菜单表")
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("菜单主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("菜单名称")
    private String menuName;

    @ApiModelProperty("路由组件")
    private String component;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("前端路由path")
    private String path;

    @ApiModelProperty("菜单图标编号")
    private Integer iconId;

    @ApiModelProperty("菜单图标url")
    @TableField(exist = false)
    private String iconUrl;

    @ApiModelProperty("父菜单编号")
    private Integer parentId;

    @ApiModelProperty("是否需要权限。(0否，1是)")
    @TableField(value = "requireAuth")
    private Integer requireAuth;

    @ApiModelProperty("是否保持激活")
    @TableField(value = "keepAlive")
    private Integer keepAlive;

    @ApiModelProperty("是否启用。(0未启用，1启用。)")
    private Integer enabled;

    @ApiModelProperty("0目录，1菜单，2功能按钮")
    private Integer type;

    @ApiModelProperty("url")
    private String url;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("是否删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("子菜单")
    @TableField(exist = false)
    private List<Menu> children;
}
